﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Ls.Data; 
using Ls.Utils; 

namespace Ls.Core
{
    public partial class BaseService
    { 

        //protected static void Logger(string function, Action tryHandle, Action<Exception> catchHandle = null, Action finallyHandle = null)
        //{
        //    Utils.Log.log4net.ILog L = LogManager.GetLogger(StackTraceHelper.GetClassFullName());
        //    LogHelper.Logger(L, function, ErrorHandle.Throw, tryHandle, catchHandle, finallyHandle);
        //}

        //protected static void Logger(string function, ErrorHandle errorHandleType, Action tryHandle, Action<Exception> catchHandle = null, Action finallyHandle = null)
        //{
        //    Utils.Log.log4net.ILog L = LogManager.GetLogger(StackTraceHelper.GetClassFullName());
        //    LogHelper.Logger(L, function, errorHandleType, tryHandle, catchHandle, finallyHandle);
        //}


        //public void Logger(string position, string target, string type, object message)
        //{
        //    using (var context = Db.Context().UseSharedConnection(true))
        //    {
        //        var user = AuthHelper.GetUserData<dynamic>();
        //        context.Insert("sys_log")
        //            .Column("UserCode", user.UserCode)
        //            .Column("UserName", user.UserName)
        //            .Column("Position", position)
        //            .Column("Target", target)
        //            .Column("Type", type)
        //            .Column("Message", JsonHelper.ToJson(message))
        //            .Column("Date", DateTime.Now)
        //            .Execute();
        //    }
        //}
    }
}
